package client.gui.ingame;

import java.awt.Color;
import java.awt.Graphics2D;

import lib.Config;
import lib.player.Player;
import lib.player.PlayerList;

public class DrawScore {
	PlayerList pl;
	int[] Teamscores;
	int xGrid;
	public DrawScore(PlayerList list,int[] Teamscores,int xGrid) {
		pl=list;
		this.Teamscores=Teamscores;
		this.xGrid=xGrid;
	}
	
	public void draw(Graphics2D g){
		g.setColor(Config.fontColor);
		int y=Config.yRes - Config.yRes / 30 * 6+ 20;
		int x=Config.xRes / 5+xGrid*2;
		g.drawString("Name:   Score:   Item: ", x, y);
		String []score=pl.score();
		int i=0;
		for(Player p:pl.list){
			g.setColor(p.color);
			g.drawString(score[i++],x, y+p.nr*20);
		}		
		x=Config.xRes/2+100+xGrid;
		g.setColor(Config.fontColor);
		g.drawString("Team Scores",x-20, y);
		g.setColor(Color.red);
		g.drawString("Team 1: "+Teamscores[0],x, y+20);
		g.setColor(Color.blue);
		g.drawString("Team 2: "+Teamscores[1],x, y+40);
	}

}
